<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>当鼠标移动时  相应的值 发生变化</title>
		<style type="text/css">
			#areaDiv{
				width: 200px;
				height: 50px;
				border: #000000 2px solid;
				margin-bottom: 20px;
				
			}
			#showMsg{
				width: 100px;
				height: 50px;
				border: #000000 2px solid;
			}
		</style>
	</head>
	<body>
		<div id="areaDiv">
			
		</div>
		<div id="showMsg">
			
		</div>
		<script type="text/javascript">
			
			window.onload = function(){
				var areaDiv = document.getElementById("areaDiv");
				var showMsg = document.getElementById("showMsg");
				areaDiv.onmouseover = function(event){
					/* 
						
						cilentX 可以获取鼠标指针的水平坐标
						cilentY 可以获取鼠标指针的吹直坐标
					 
					 */
					var x = event.clientX;
					var y = event.clientY;
		
					showMsg.innerHTML ="x="+x+",y =" +y ;
				}
				
				
			}
			
		</script>
	</body>
</html>
